package cn.sytton.taffecloud.serivce.auth.controller;

import cn.sytton.taffecloud.common.base.doc.Api;
import cn.sytton.taffecloud.common.base.doc.ApiImplicitParam;
import cn.sytton.taffecloud.common.base.doc.ApiOperation;
import cn.sytton.taffecloud.common.base.doc.ParamType;
import cn.sytton.taffecloud.common.base.security.LoginUser;
import cn.sytton.taffecloud.serivce.auth.service.IProfileService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Profile控制层
 *
 * @author skyrock
 */
@Api(tags = "Profile")
@RestController
@RequestMapping("/profile")
public class ProfileController {

    @Resource
    private IProfileService profileService;

    @ApiOperation(value = "获取当前登录用户信息")
    @ApiImplicitParam(paramType = ParamType.header, name = "Authorization", value = "token")
    @GetMapping
    public LoginUser profile(){
        return profileService.profile();
    }
}
